<?php

/*
 * Read content of file
 * @param $path : Path of the file
 * The same     : readfile($path)
 */
$path = './uploads/test.txt';
$fileContent = file_get_contents($path);
?>


<?php 
/*
 * Put content into file
 * If the content of file is not empty, it will append content in to the file
 * @param $path    : Path of the file
 * $param $content : fileContent of file 
 * The same        :  fopen(), fwrite() and fclose()
 */
$path = './uploads/cdf.txt';
file_put_contents($path, $fileContent, FILE_APPEND | LOCK_EX)
?>